﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Common;
using System.IO;
using EcSalseManage.App_Code;
using System.Net;

namespace EcSalseManage.EcSalse
{
    public partial class Report_BuyStandAlone_Detail : System.Web.UI.Page
    {

        #region 页面初始化
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!CommonFunction.isInPrev("Report_Deal_0001"))
                {
                    Response.Redirect("../Error/Perm_Error.aspx");
                }
                if (!CommonFunction.isInPrev("Report_Deal_0002"))
                {
                    this.btnSave.Enabled = false;
                }
                if (!CommonFunction.isInPrev("Report_Deal_0003"))
                {
                    this.btnDelete.Enabled = false;
                }

                this.btnSave.Attributes.Add("onClick", "javascript:if(Page_ClientValidate()) return DataCheck();");

                DataAccess.Operate.DA_Report_PropertyType_Inherit Report_PropertyType_Inherit = new DataAccess.Operate.DA_Report_PropertyType_Inherit();
                DataSet ds = Report_PropertyType_Inherit.FindLibrary();
                this.radlPropertyType.DataSource = ds.Tables[0];
                this.radlPropertyType.DataTextField = "Report_PropertyType_Name";
                this.radlPropertyType.DataValueField = "Report_PropertyType_ID";
                this.radlPropertyType.DataBind();

                DataAccess.Operate.DA_Report_Attach_Inherit Report_Attach_Inherit = new DataAccess.Operate.DA_Report_Attach_Inherit();
                ds = Report_Attach_Inherit.FindLibrary();
                Common.Common_Function.DropDownListBind(ddlFileType, ds.Tables[0], "Report_File_ID", "Report_File_Name", "", "--请选择附件类型--");
                this.btnUpLoad.Attributes.Add("onClick", "return checkUpload()");


                //租赁成交
                this.lblReport_BuyStandAlone_PayType.Visible = false;
                this.txtReport_BuyStandAlone_PayType.Visible = false;
                this.rfvReport_BuyStandAlone_PayType.Enabled = false;

                this.lblReport_BuyStandAlone_Subscribe.Text = "合同编号";
                this.rfvReport_BuyStandAlone_Subscribe.ErrorMessage = "合同编号不能为空";
                this.lblReport_BuyStandAlone_SellUnit.Text = "租赁单位";
                this.rfvReport_BuyStandAlone_SellUnit.ErrorMessage = "租赁单位不能为空";
                this.lblReport_BuyStandAlone_Buyer.Text = "租赁人";
                this.rfvReport_BuyStandAlone_Buyer.ErrorMessage = "租赁人不能为空";
                this.lblReport_BuyStandAlone_Area.Text = "建筑面积";
                this.rfvReport_BuyStandAlone_Area.ErrorMessage = "建筑面积不能为空";
                this.lblReport_BuyStandAlone_Discount.Text = "租金";
                this.rfvReport_BuyStandAlone_Discount.ErrorMessage = "租金不能为空";
                this.lblReport_BuyStandAlone_Price.Text = "佣金";
                this.rfvReport_BuyStandAlone_Price.ErrorMessage = "佣金不能为空";


                if (Request.QueryString["id"] != null)
                {
                    ViewState["id"] = Request.QueryString["id"].ToString();
                    Update_Data_Bind(ViewState["id"].ToString());
                    BindGrid();
                    btnUpLoad.Visible = true;
                    dgList.Visible = true;
                    btnReset.Visible = false;
                    btnDelete.Visible = true;
                    this.Report_Tab1.Visible = true;
                    this.Report_Tab1.MainID = ViewState["id"].ToString();
                    this.Report_Tab1.ExchangeTypeID = "4";
                }
                else if (Session["ProjectID"] != null)
                {

                    DataAccess.Operate.DA_Report_BuyStandAlone_Inherit Report_BuyStandAlone_Inherit = new DataAccess.Operate.DA_Report_BuyStandAlone_Inherit();
                    this.lblProjectName.Text = Report_BuyStandAlone_Inherit.getProjectName(Session["ProjectID"].ToString());
                    this.btnAudit.Visible = false;
                    ViewState["id"] = null;

                }


            }

        }
        #endregion

        #region 附件GRIDVIEW绑定
        private void BindGrid()
        {
            DataSet ds = new DataSet();
            DataAccess.Operate.DA_Report_Attach_Inherit Report_Attach_Inherit = new DataAccess.Operate.DA_Report_Attach_Inherit();

            dgList.DataBind();

            ds = Report_Attach_Inherit.GetAllByReportID(ViewState["id"].ToString());
            dgList.DataSource = ds;
            dgList.DataBind();
        }
        #endregion


        private void Update_Data_Bind(string id)
        {

            DataAccess.Operate.DA_Report_BuyStandAlone_Operate Report_BuyStandAlone_Operate = new DataAccess.Operate.DA_Report_BuyStandAlone_Operate();
            DataEntity.T_Report_BuyStandAlone Report_BuyStandAlone = new DataEntity.T_Report_BuyStandAlone();
            Report_BuyStandAlone = (DataEntity.T_Report_BuyStandAlone)Report_BuyStandAlone_Operate.SelectOne(id);

            this.txtReport_BuyStandAlone_AgencyCost.Text = Report_BuyStandAlone.Report_BuyStandAlone_AgencyCost.ToString();
            this.txtReport_BuyStandAlone_Area.Text = Report_BuyStandAlone.Report_BuyStandAlone_Area.ToString();
            this.txtReport_BuyStandAlone_Buyer.Text = Report_BuyStandAlone.Report_BuyStandAlone_Buyer.ToString();
            this.txtReport_BuyStandAlone_CancelComm.Text = Report_BuyStandAlone.Report_BuyStandAlone_CancelComm.ToString();
            this.txtReport_BuyStandAlone_Discount.Text = Report_BuyStandAlone.Report_BuyStandAlone_Discount.ToString();
            this.txtReport_BuyStandAlone_ExchangeDate.Text = Report_BuyStandAlone.Report_BuyStandAlone_ExchangeDate.ToString();
            this.txtReport_BuyStandAlone_Margins.Text = Report_BuyStandAlone.Report_BuyStandAlone_Margins.ToString();
            this.txtReport_BuyStandAlone_Operator.Text = Report_BuyStandAlone.Report_BuyStandAlone_Operator.ToString();
            this.txtReport_BuyStandAlone_PayType.Text = Report_BuyStandAlone.Report_BuyStandAlone_PayType.ToString();
            this.txtReport_BuyStandAlone_Price.Text = Report_BuyStandAlone.Report_BuyStandAlone_Price.ToString();
            this.txtReport_BuyStandAlone_Remark.Text = Report_BuyStandAlone.Report_BuyStandAlone_Remark.ToString();
            this.radlPropertyType.SelectedValue = Report_BuyStandAlone.Report_BuyStandAlone_PropertyTypeID.ToString();
            this.txtReport_BuyStandAlone_ReportNO.Text = Report_BuyStandAlone.Report_BuyStandAlone_ReportNO.ToString();
            this.txtReport_BuyStandAlone_SellUnit.Text = Report_BuyStandAlone.Report_BuyStandAlone_SellUnit.ToString();
            this.txtReport_BuyStandAlone_Subscribe.Text = Report_BuyStandAlone.Report_BuyStandAlone_Subscribe.ToString();

            DataAccess.Operate.DA_Report_BuyStandAlone_Inherit Report_BuyStandAlone_Inherit = new DataAccess.Operate.DA_Report_BuyStandAlone_Inherit();
            this.lblProjectName.Text = Report_BuyStandAlone_Inherit.getProjectName(Report_BuyStandAlone.Report_BuyStandAlone_ProjectID.ToString());
            ViewState["ProjectID"] = Report_BuyStandAlone.Report_BuyStandAlone_ProjectID.ToString();

            if (Report_BuyStandAlone.Report_Plan_Audit > 8)
            {
                this.btnSave.Enabled = false;
                this.btnDelete.Enabled = false;
            }
           
            if (Report_BuyStandAlone.Report_Plan_Audit == 8)
                this.btnAudit.Text = "项经审核";
            if (Report_BuyStandAlone.Report_Plan_Audit == 10)
                this.btnAudit.Text = "营销[副]总监审核";
            if (Report_BuyStandAlone.Report_Plan_Audit == 11)
            {
                this.btnAudit.Text = "审核已完成";
                this.btnAudit.Enabled = false;
            }

            if (!CommonFunction.isInPrev("Report_Deal_0005") && this.btnAudit.Text == "项经审核")
            {
                this.btnAudit.Enabled = false;
            }
            if (!CommonFunction.isInPrev("Report_Deal_0006") && this.btnAudit.Text == "营销[副]总监审核")
            {
                this.btnAudit.Enabled = false;
            }
        }

        protected void dgList_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                if (e.Item.ItemIndex > -1)
                {
                    ImageButton imgbtnDelete = (ImageButton)e.Item.FindControl("imgbtnDelete");
                    imgbtnDelete.Attributes.Add("onclick", "return window.confirm(\"是否确定删除？\")");

                }
            }
        }

        protected void dgList_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            DataAccess.Operate.DA_Report_Attach_Operate Report_Attach_Operate = new DataAccess.Operate.DA_Report_Attach_Operate();
            if (e.CommandName.ToString() == "Delete")
            {
                try
                {
                    Report_Attach_Operate.Delete(new Guid(dgList.DataKeys[e.Item.ItemIndex].ToString()));
                    DataAccess.Multi.System_Multi.addLog(Session["EmployeeID"].ToString(), Session["EmployeeName"].ToString(), 5, new Guid(ViewState["id"].ToString()), 3);
                    this.BindGrid();
                }
                catch (System.Exception ex)
                {
                    throw new Exception(ex.Message.ToString());
                }
                finally
                {
                    Report_Attach_Operate = null;
                }
            }
        }


        #region 保存
        protected void btnSave_Click(object sender, EventArgs e)
        {
            DataAccess.Operate.DA_Report_BuyStandAlone_Operate Report_BuyStandAlone_Operate = new DataAccess.Operate.DA_Report_BuyStandAlone_Operate();

            DataEntity.T_Report_BuyStandAlone Report_BuyStandAlone = new DataEntity.T_Report_BuyStandAlone();
            Report_BuyStandAlone.Report_BuyStandAlone_AgencyCost = Convert.ToDecimal(this.txtReport_BuyStandAlone_AgencyCost.Text.Trim());
            Report_BuyStandAlone.Report_BuyStandAlone_Area = Convert.ToDecimal(this.txtReport_BuyStandAlone_Area.Text.Trim());
            Report_BuyStandAlone.Report_BuyStandAlone_Buyer = this.txtReport_BuyStandAlone_Buyer.Text.Trim();
            Report_BuyStandAlone.Report_BuyStandAlone_CancelComm = Convert.ToDecimal(this.txtReport_BuyStandAlone_CancelComm.Text.Trim());
            Report_BuyStandAlone.Report_BuyStandAlone_Discount = Convert.ToDecimal(this.txtReport_BuyStandAlone_Discount.Text.Trim());
            Report_BuyStandAlone.Report_BuyStandAlone_ExchangeDate = Convert.ToDateTime(this.txtReport_BuyStandAlone_ExchangeDate.Text.Trim());
            Report_BuyStandAlone.Report_BuyStandAlone_ExchangeTypeID = 4;
            Report_BuyStandAlone.Report_BuyStandAlone_Margins = Convert.ToDecimal(this.txtReport_BuyStandAlone_Margins.Text.Trim());
            Report_BuyStandAlone.Report_BuyStandAlone_Operator = this.txtReport_BuyStandAlone_Operator.Text.Trim();
            Report_BuyStandAlone.Report_BuyStandAlone_PayType = this.txtReport_BuyStandAlone_PayType.Text.Trim();
            Report_BuyStandAlone.Report_BuyStandAlone_Price = Convert.ToDecimal(this.txtReport_BuyStandAlone_Price.Text.Trim());
            Report_BuyStandAlone.Report_BuyStandAlone_Remark = this.txtReport_BuyStandAlone_Remark.Text.Trim();
            Report_BuyStandAlone.Report_BuyStandAlone_PropertyTypeID = Convert.ToInt32(radlPropertyType.SelectedValue);
            Report_BuyStandAlone.Report_BuyStandAlone_ReportNO = this.txtReport_BuyStandAlone_ReportNO.Text.Trim();
            Report_BuyStandAlone.Report_BuyStandAlone_SellUnit = this.txtReport_BuyStandAlone_SellUnit.Text.Trim();
            Report_BuyStandAlone.Report_BuyStandAlone_Subscribe = this.txtReport_BuyStandAlone_Subscribe.Text.Trim();
            Report_BuyStandAlone.Report_Plan_Audit = 8;
            Guid gReport = Guid.NewGuid();
            if (ViewState["id"] == null)
            {
                Report_BuyStandAlone.Report_BuyStandAlone_ID = gReport;
                Report_BuyStandAlone.Report_BuyStandAlone_ProjectID = new Guid(Session["ProjectID"].ToString());
                if (Report_BuyStandAlone_Operate.Insert(Report_BuyStandAlone))
                {

                    DataAccess.Multi.System_Multi.addLog(Session["EmployeeID"].ToString(), Session["EmployeeName"].ToString(), 1, gReport, 1);

                    #region 上传附件部分
                    DataAccess.Operate.DA_Report_Attach_Operate Report_Attach_Operate = new DataAccess.Operate.DA_Report_Attach_Operate();
                    DataEntity.T_Report_Attach Report_Attach = new DataEntity.T_Report_Attach();
                    string sFileName = "";
                    string sFilePath = "";
                    string sFileType = "";

                    if (!Directory.Exists("\\\\gzs-ecc02\\ReportManager\\" + DateTime.Now.Year.ToString()))
                    {
                        Directory.CreateDirectory("\\\\gzs-ecc02\\ReportManager\\" + DateTime.Now.Year.ToString());
                    }
                    if (!Directory.Exists("\\\\gzs-ecc02\\ReportManager\\" + DateTime.Now.Year.ToString() + "\\" + gReport.ToString()))
                    {
                        Directory.CreateDirectory("\\\\gzs-ecc02\\ReportManager\\" + DateTime.Now.Year.ToString() + "\\" + gReport.ToString());
                    }

                    sFileType = CommonFunction.CheckFileType(this.txtFilePath.PostedFile.FileName);
                    if (sFileType != "")
                    {
                        sFileName = gReport.ToString() + DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.Hour + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() + DateTime.Now.Millisecond.ToString() + sFileType;
                    }

                    sFilePath = "/ReportManager/" + DateTime.Now.Year + "/" + gReport.ToString() + "/" + sFileName;
                    try
                    {
                        Report_Attach.Project_Report_FileDesc = this.txtProjectDesc.Text.Trim();
                        Report_Attach.Project_Report_FileName = sFileName;
                        Report_Attach.Project_Report_FilePath = sFilePath;
                        Report_Attach.Project_Report_ExchangeTypeID = 11;
                        Report_Attach.Project_Report_FileID = Convert.ToInt32(this.ddlFileType.SelectedValue);
                        Report_Attach.Project_Report_MainID = gReport;
                        Report_Attach_Operate.Insert(Report_Attach);
                        this.txtFilePath.PostedFile.SaveAs("\\\\gzs-ecc02\\ReportManager\\" + DateTime.Now.Year.ToString() + "\\" + gReport.ToString() + "\\" + sFileName);
                        DataAccess.Multi.System_Multi.addLog(Session["EmployeeID"].ToString(), Session["EmployeeName"].ToString(), 5, gReport, 4);

                    }
                    catch (System.Exception ex)
                    {
                        throw new Exception(ex.Message.ToString());
                    }
                    finally
                    {

                    }

                    #endregion

                    SendMessage("10", Session["ProjectID"].ToString());
                    Response.Write("<script>alert('" + Common_Const.MSG_ALL_INSERT_SUCCESS + "');</script>");
                   
                    ClearForm();
                }
                else
                {
                    Response.Write("<script>alert('" + Common_Const.MSG_ALL_INSERT_FAILS + "');</script>");
                }
            }
            else
            {
                Report_BuyStandAlone.Report_BuyStandAlone_ID = new Guid(ViewState["id"].ToString());
                if (Report_BuyStandAlone_Operate.Update(Report_BuyStandAlone))
                {
                    DataAccess.Multi.System_Multi.addLog(Session["EmployeeID"].ToString(), Session["EmployeeName"].ToString(), 1, gReport, 2);
                    Response.Write("<script>alert('" + Common_Const.MSG_ALL_UPDATE_SUCCESS + "');</script>");
                }
                else
                {
                    Response.Write("<script>alert('" + Common_Const.MSG_ALL_UPDATE_FAILS + "');</script>");
                }
            }
        }
        #endregion

        #region WebClient上传附件
        /// <summary>
        /// WebClient上传文件至服务器
        /// </summary>
        /// <param name="fileNamePath">文件名，全路径格式</param>
        /// <param name="uriString">服务器文件夹路径</param>
        public void UpLoadFile(string fileNamePath, string uriString)
        {
            /**/
            /// 创建WebClient实例 
            WebClient myWebClient = new WebClient();
            myWebClient.Credentials = CredentialCache.DefaultCredentials;
            // 要上传的文件 
            FileStream fs = new FileStream(fileNamePath, FileMode.Open, FileAccess.Read);
            // FileStream fs = OpenFile(); 
            BinaryReader r = new BinaryReader(fs);
            byte[] postArray = r.ReadBytes((int)fs.Length);
            Stream postStream = myWebClient.OpenWrite(uriString, " PUT ");
            try
            {

                // 使用UploadFile方法可以用下面的格式
                // myWebClient.UploadFile(uriString,"PUT",fileNamePath); 


                if (postStream.CanWrite)
                {
                    postStream.Write(postArray, 0, postArray.Length);
                    postStream.Close();
                    fs.Dispose();
                }
                else
                {
                    postStream.Close();
                    fs.Dispose();

                }
            }
            catch (Exception err)
            {
                postStream.Close();
                fs.Dispose();
                // Utility.LogWriter log = new Utility.LogWriter(); 
                throw err;
            }
            finally
            {
                postStream.Close();
                fs.Dispose();
            }
        }
        #endregion

        #region 提交成功后清空表单
        private void ClearForm()
        {
            Control frm = FindControl("Form1");
            foreach (Control ctrl in frm.Controls)
            {
                if (ctrl is TextBox)
                {
                    ((TextBox)ctrl).Text = " ";
                }
            }

            this.radlPropertyType.SelectedItem.Selected = false;
        }
        #endregion

        #region 删除操作
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            DataAccess.Operate.DA_Report_BuyStandAlone_Operate Report_BuyStandAlone_Operate = new DataAccess.Operate.DA_Report_BuyStandAlone_Operate();
            if (Report_BuyStandAlone_Operate.Delete(ViewState["id"].ToString()))
            {
                DataAccess.Multi.System_Multi.addLog(Session["EmployeeID"].ToString(), Session["EmployeeName"].ToString(), 1, new Guid(ViewState["id"].ToString()), 3);
                Response.Write("<script>alert('" + Common_Const.MSG_ALL_DELETE_SUCCESS + "');window.close();</script>");
            }
            else
            {
                Response.Write("<script>alert('" + Common_Const.MSG_ALL_DELETE_FAILS + "');</script>");
            }
        }
        #endregion

        #region 上传操作
        protected void btnUpLoad_Click(object sender, EventArgs e)
        {
            DataAccess.Operate.DA_Report_Attach_Operate Report_Attach_Operate = new DataAccess.Operate.DA_Report_Attach_Operate();
            DataEntity.T_Report_Attach Report_Attach = new DataEntity.T_Report_Attach();
            string sFileName = "";
            string sFilePath = "";
            string sFileType = "";

            Guid gReportID = new Guid(ViewState["id"].ToString());
            if (!Directory.Exists("\\\\gzs-ecc02\\ReportManager\\" + DateTime.Now.Year.ToString()))
            {
                Directory.CreateDirectory("\\\\gzs-ecc02\\ReportManager\\" + DateTime.Now.Year.ToString());
            }
            if (!Directory.Exists("\\\\gzs-ecc02\\ReportManager\\" + DateTime.Now.Year.ToString() + "\\" + gReportID.ToString()))
            {
                Directory.CreateDirectory("\\\\gzs-ecc02\\ReportManager\\" + DateTime.Now.Year.ToString() + "\\" + gReportID.ToString());
            }

            sFileType = CommonFunction.CheckFileType(this.txtFilePath.PostedFile.FileName);
            if (sFileType != "")
            {
                sFileName = gReportID.ToString() + DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.Hour + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() + DateTime.Now.Millisecond.ToString() + sFileType;
            }

            sFilePath = "/ReportManager/" + DateTime.Now.Year + "/" + gReportID.ToString() + "/" + sFileName;
            try
            {
                Report_Attach.Project_Report_FileDesc = this.txtProjectDesc.Text.Trim();
                Report_Attach.Project_Report_FileName = sFileName;
                Report_Attach.Project_Report_FilePath = sFilePath;
                Report_Attach.Project_Report_ExchangeTypeID = 11;
                Report_Attach.Project_Report_FileID = Convert.ToInt32(this.ddlFileType.SelectedValue);
                Report_Attach.Project_Report_MainID = new Guid(gReportID.ToString());
                Report_Attach_Operate.Insert(Report_Attach);
                this.txtFilePath.PostedFile.SaveAs("\\\\gzs-ecc02\\ReportManager\\" + DateTime.Now.Year.ToString() + "\\" + gReportID.ToString() + "\\" + sFileName);
                DataAccess.Multi.System_Multi.addLog(Session["EmployeeID"].ToString(), Session["EmployeeName"].ToString(), 5, new Guid(gReportID.ToString()), 4);
                BindGrid();
            }
            catch (System.Exception ex)
            {
                throw new Exception(ex.Message.ToString());
            }
            finally
            {
                this.ddlFileType.SelectedValue = "";
            }
        }
        #endregion

        protected void btnAudit_Click(object sender, EventArgs e)
        {
            if (this.btnAudit.Text == "项经审核")
            {
                DataAccess.Operate.DA_Report_BuyStandAlone_Inherit Report_BuyStandAlone_Inherit = new DataAccess.Operate.DA_Report_BuyStandAlone_Inherit();
                if(Report_BuyStandAlone_Inherit.AuditByID(ViewState["id"].ToString(),"10"))
                {
                   
                    DataAccess.Multi.System_Multi.addLog(Session["EmployeeID"].ToString(), Session["EmployeeName"].ToString(), 6, new Guid(ViewState["id"].ToString()), 10);
                    SendMessage("5", ViewState["ProjectID"].ToString());
                    Response.Write("<script>alert('审核成功');window.close();</script>");
                }
            }
            else if (this.btnAudit.Text == "营销[副]总监审核")
            {
                DataAccess.Operate.DA_Report_BuyStandAlone_Inherit Report_BuyStandAlone_Inherit = new DataAccess.Operate.DA_Report_BuyStandAlone_Inherit();
                if (Report_BuyStandAlone_Inherit.AuditByID(ViewState["id"].ToString(), "11"))
                {
                    DataAccess.Multi.System_Multi.addLog(Session["EmployeeID"].ToString(), Session["EmployeeName"].ToString(), 6, new Guid(ViewState["id"].ToString()), 5);
                    Response.Write("<script>alert('审核成功');window.close();</script>");
                }
            }
        }

        public void SendMessage(string operate, string project)
        {
            string projectNo = "";
            DataAccess.Operate.DA_Project_Inherit Project_Inherit = new DataAccess.Operate.DA_Project_Inherit();
            string[] array = Project_Inherit.getCodeAndName(out projectNo, operate, project);
            string sTitle = "请注意，项目编号:" + projectNo + "中的租赁成交报告需要您的审批。";
            string sBody = "请注意，项目编号:" + projectNo + " 中的租赁成交报告需要您的审批。<a href='http://wap.gzcentaline.com.cn'>点击此处</a>";
            // array[1] 姓名 ，array[0] 工号
            EcSalseManage.App_Code.CommonFunction.SendMessage(array[1], array[0], sTitle, sBody);

        }

    }
}